package com.zlsy.thread.threadpool;

/**
 * @author zhouliang
 * @date 2020/6/20 18:07
 * <p>
 * 每个任务创建一个线程
 */
public class ForLoop {
    public static void main(String[] args) {

        //定义一个定时任务的线程池
        for (int i = 0; i < 100; i++) {
            Task r = new Task();
            Thread thread = new Thread(r);
            thread.start();
        }
    }

    static class Task implements Runnable {

        @Override
        public void run() {
            System.out.println("执行了任务！");
        }
    }
}
